﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example10.aspx.cs" Inherits="Chapter40.Example10" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 40-10 检测浏览器状态</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
    The browser is: <span id="network">unknow.</span>.
    <script>
        var network;
        if (window.navigator.onLine) {
            network = 'online';
        } else {
            network = 'offline';
        }
        document.getElementById('network').innerHTML = network;
    </script>
</body>
</html>
